package com.etooling.framework.entity;

import com.etooling.framework.svo.AbstractEntity;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * @author X
 * @title: ImportDataBatch
 * @projectName ems
 * @description: TODO
 * @date 2021/7/911:59
 */
@Entity
@Data
@Table(name = "imp_data_bach", schema = "import_data")
public class ImportDataBatch extends AbstractEntity {
    //上传Excel文件的状态
    public static final String STATUS_UPLOAD_DOING = "上传中";
    public static final String STATUS_UPLOAD_COMPLETED = "上传完成";
    public static final String STATUS_UPLOAD_FAILE = "上传失败";
    //根据Excel修改数据库 的状态
    public static final String STATUS_SUBMIT_DOING = "提交中";
    public static final String STATUS_SUBMIT_COMPLETED = "提交完成";
    public static final String STATUS_SUBMIT_FAILE = "提交失败";
    // 上传类型
    public static final String TYPE_IMPORT_BOM = "BOM表上传";

    String fileName;
    AttachFile attachFile;
    Date createTime;
    Date doneTime;
    String fileType;
    Long dataCnt;//数据量
    String implMemo;//导入结果描述
    String errorMemo; //异常备注
    String status;//完成状态
    String uploadCompanyId; //上传人员账套ID
    Employee uploadUser;
    String bomName;//自定义BOM表名称
    String memo;//bom备注信息
    String goodsSpecsId;//产品规格id
    @ManyToOne(targetEntity = Employee.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "upload_user_id")
    public Employee getUploadUser() {
        return uploadUser;
    }

    public void setUploadUser(Employee uploadUser) {
        this.uploadUser = uploadUser;
    }

    public String getUploadCompanyId() {
        return uploadCompanyId;
    }

    public void setUploadCompanyId(String uploadCompanyId) {
        this.uploadCompanyId = uploadCompanyId;
    }

    public Date getDoneTime() {
        return doneTime;
    }

    public void setDoneTime(Date doneTime) {
        this.doneTime = doneTime;
    }

    @Column(columnDefinition = "text")
    public String getErrorMemo() {
        return errorMemo;
    }

    public void setErrorMemo(String errorMemo) {
        this.errorMemo = errorMemo;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Column(columnDefinition = "text")
    public String getImplMemo() {
        return implMemo;
    }

    public void setImplMemo(String implMemo) {
        this.implMemo = implMemo;
    }

    public Long getDataCnt() {
        return dataCnt;
    }

    public void setDataCnt(Long dataCnt) {
        this.dataCnt = dataCnt;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    @ManyToOne(targetEntity = AttachFile.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "avatar_file_id")
    public AttachFile getAttachFile() {
        return attachFile;
    }

    public void setAttachFile(AttachFile attachFile) {
        this.attachFile = attachFile;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getBomName() {
        return bomName;
    }

    public void setBomName(String bomName) {
        this.bomName = bomName;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getGoodsSpecsId() {
        return goodsSpecsId;
    }

    public void setGoodsSpecsId(String goodsSpecsId) {
        this.goodsSpecsId = goodsSpecsId;
    }
}
